UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UWu7zb1pP0lEVe3WbzHiyQwY7pJ8KXBoVq8rYzHaDnQ=' 
WHERE 
  key_id = '22483aca311fb088a114d6670e8c4fe24e241f74aedaa13e1daca01cda37889e' 
  AND (
    token = 'UWu7zb1pP0lEVe3WbzHiyQwY7pJ8KXBoVq8rYzHaDnQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022