UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1a+XY95as/wA2JQJRBGC36wJdL4jVae/I8PLf+sRAZw=' 
WHERE 
  key_id = '20adbd64b61ba4e674997d92b7a7f98a776cc4d6ee5a698558acf07c1622d118' 
  AND (
    token = '1a+XY95as/wA2JQJRBGC36wJdL4jVae/I8PLf+sRAZw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017