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

Query time 0.00032