UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Zkn31cKs+zpuUfN8EBqRxsTU8AHIw2h2dIhQ0MXclQ8=' 
WHERE 
  key_id = 'f8327c5672f6789756f081cd9639733039aeea7aaafcadfc911e8a4cb0735015' 
  AND (
    token = 'Zkn31cKs+zpuUfN8EBqRxsTU8AHIw2h2dIhQ0MXclQ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033