UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uLvQs8uzi26tKDqk5nLZTSGQLpnCK8cZgvU3M8mvvlA=' 
WHERE 
  key_id = 'fdc76dcd416ba417794dc2c466fe8e9801daab591123b65f2e1cbe75894b6990' 
  AND (
    token = 'uLvQs8uzi26tKDqk5nLZTSGQLpnCK8cZgvU3M8mvvlA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033