UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wvCGn0/Mrc2vFkCRNZqFqLDBCl5Fenzr/MA2mfF6+uM=' 
WHERE 
  key_id = '696d00e40dbae29c6d87cf287db9316bb8346d859b4ac9d0a87c1fbc787dde4e' 
  AND (
    token = 'wvCGn0/Mrc2vFkCRNZqFqLDBCl5Fenzr/MA2mfF6+uM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036