UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3Fyh76I/ftDegkAbsXUrpDsQ/F0e33txp6s+pBQPFh4=' 
WHERE 
  key_id = '67110f906981d48aa84bd904106419e7690a73f1abb265b629df19dde605eec1' 
  AND (
    token = '3Fyh76I/ftDegkAbsXUrpDsQ/F0e33txp6s+pBQPFh4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00128