UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't71zqm3XOCPMXXNL/Q3o3KBVZWdzFHpiE39eqhG47hg='
WHERE
key_id = 'eab6098237dabdeb161ae0bc720301cff20284de6ec25c6463e9e58ccd3c7323'
AND (
token = 't71zqm3XOCPMXXNL/Q3o3KBVZWdzFHpiE39eqhG47hg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)