UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UmITHTvgFJdqdC5s/0zlVKZ86Nymxb1FBJRudRJbASk='
WHERE
key_id = '08b7cab23ea87e9d9e01268e98e9a08965d508cbb89ffade6695758061030221'
AND (
token = 'UmITHTvgFJdqdC5s/0zlVKZ86Nymxb1FBJRudRJbASk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)