UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CPRNK1eX9IU/yTlRM3n9qXahJu8lU4XGOB//nW8U098=' 
WHERE 
  key_id = 'e2f89366d439338d7e91233abbce77e54ccb8b884a9b5db858884d3870deb11a' 
  AND (
    token = 'CPRNK1eX9IU/yTlRM3n9qXahJu8lU4XGOB//nW8U098=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035