UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uz76/35oGlxBKLuevqJVb0XJXQ+x6QRazW/hASq4dqc=' 
WHERE 
  key_id = 'ff2d0e5a6b8cdd2a94005a36ed1795d680053fcfdbbe24efd87c7e095ffec9bd' 
  AND (
    token = 'uz76/35oGlxBKLuevqJVb0XJXQ+x6QRazW/hASq4dqc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027