UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd/dtu3qqmlZT+Ardx7UrWh8+B1X8XAAuU5aWIJPxY7Y=' 
WHERE 
  key_id = 'c2cecb3e5ac24c531c742118ced0e1b708fef7912d74abfe282e4e27dacd726c' 
  AND (
    token = 'd/dtu3qqmlZT+Ardx7UrWh8+B1X8XAAuU5aWIJPxY7Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042