UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QxHRM9hzLp3903acbS1G1vYm1U1CP9ke3RQA+tSmTAQ=' 
WHERE 
  key_id = '718b96c3aff523440873f6bebb55fa20e70fbad60426e3cfbdd6b60f0e17ff4a' 
  AND (
    token = 'QxHRM9hzLp3903acbS1G1vYm1U1CP9ke3RQA+tSmTAQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047