UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e08BYtOmafI5n5UckFwofMXQ/lUiZJrKzNItIwmK5HU=' 
WHERE 
  key_id = 'bac1f61806856e10f06c0029bb08343eca51e59f34691566bc58d85b09711aa1' 
  AND (
    token = 'e08BYtOmafI5n5UckFwofMXQ/lUiZJrKzNItIwmK5HU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00011