UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0f0bQlVyFTCFt26Bklx+ZZZQs9nxF6nP/cutToo57rI=' 
WHERE 
  key_id = '6fd15495749aaf6c9a11dbb8e88f4c4f68c2bf4ebe4cc01bce1ab410abe2e489' 
  AND (
    token = '0f0bQlVyFTCFt26Bklx+ZZZQs9nxF6nP/cutToo57rI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023