UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N4EQTRDW+caRXG2eAR7vEwpsCJnyCjF/D2eJzv58t3k=' 
WHERE 
  key_id = '43c79c8cf70f4b21961d04631fb0c17b642a6b8a4d27ddab9b9283a4e744b51f' 
  AND (
    token = 'N4EQTRDW+caRXG2eAR7vEwpsCJnyCjF/D2eJzv58t3k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028