UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QE7g9s8bm7Siq9nEqnlPQVpXL1c4gTP7Qila0okCxxA=' 
WHERE 
  key_id = 'f71f4faf581ed45502df3989d048291135d9bc241809ef07ef3567dacc6fde48' 
  AND (
    token = 'QE7g9s8bm7Siq9nEqnlPQVpXL1c4gTP7Qila0okCxxA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028