UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NUaWzHuAustIXCPgJ0waF5KgEyODLEdKyCScdkmZ62I=' 
WHERE 
  key_id = '6109fb07145cd8b3934b7a47e44074098bafb50e34b95802711cb69d92e9fcdf' 
  AND (
    token = 'NUaWzHuAustIXCPgJ0waF5KgEyODLEdKyCScdkmZ62I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040