UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QfcX5lwcx24RMG3L4M7EqbCU5yrfpnmnNurR5LY61rA=' 
WHERE 
  key_id = '88b27bbd7333eb5c50f1a7c6757142df32b0c6e5f63ad3ce3e19c6f803aac09a' 
  AND (
    token = 'QfcX5lwcx24RMG3L4M7EqbCU5yrfpnmnNurR5LY61rA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042