UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9V2wUONVCmC0+kD4tW7ZCH4HN9h3mgjgHPgAW2aye0o=' 
WHERE 
  key_id = 'c406a5c4345be3ea288b90f488368afd80780e5f16b15a5efdc9ef54902be83b' 
  AND (
    token = '9V2wUONVCmC0+kD4tW7ZCH4HN9h3mgjgHPgAW2aye0o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017