UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CRvFUKOzkxuhsRMTMoLWjajE0yP5zUS34bRy7Eki2+E=' 
WHERE 
  key_id = '34c346868d75e4e3539a3533a0cef39fc44a3c81a36815e8241ed4c6c55743fb' 
  AND (
    token = 'CRvFUKOzkxuhsRMTMoLWjajE0yP5zUS34bRy7Eki2+E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026