UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hOrw+3yCiQIUvIbjJ7VbDWQJ2XQxEyH/+H8Rulfy/Ww=' 
WHERE 
  key_id = 'f135cf29cff11d90e126d19d19e810ddcaee48a71bc9085ec5c2d181474ee29c' 
  AND (
    token = 'hOrw+3yCiQIUvIbjJ7VbDWQJ2XQxEyH/+H8Rulfy/Ww=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017