UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WwPbjUluHGmERiAcfaYlLq/OR1XYRAqa7Mg6kAGTQ9s=' 
WHERE 
  key_id = 'dc515bd284c4a49fc1640d54262774c42fce844bfd2667fccdb9da8a49a82bde' 
  AND (
    token = 'WwPbjUluHGmERiAcfaYlLq/OR1XYRAqa7Mg6kAGTQ9s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024