UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IhUZKMquiVQF6xs7Uv8QGogIByyhpTRezef5DHKgL78=' 
WHERE 
  key_id = 'de0f58e7ba0c6e6eb92b91db4905a18024b7e4044d4a013660fca69d2b485828' 
  AND (
    token = 'IhUZKMquiVQF6xs7Uv8QGogIByyhpTRezef5DHKgL78=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00072