UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eM2yvYSlDUA7KpGU0/A3uRSvUNv5mO9Mmf0XSQ5w/3I=' 
WHERE 
  key_id = 'b94ebff235af6f5b4e6973a27fa248ac1078e562cc0792953b55920d61f97256' 
  AND (
    token = 'eM2yvYSlDUA7KpGU0/A3uRSvUNv5mO9Mmf0XSQ5w/3I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017