UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2K9mb2zI7l65hlddqmdcxKQxKl3awOke3Qm/Z4ySbWU=' 
WHERE 
  key_id = '90714b5dc72ccbf18e595a6c0e33b357fe525ee5d9f7dfe375d05faf14313490' 
  AND (
    token = '2K9mb2zI7l65hlddqmdcxKQxKl3awOke3Qm/Z4ySbWU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029