UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uqz5Jpsjg7P0QoEFHvQBMiPguN15RkuA95qnzVJDSC8='
WHERE
key_id = '1a08c0500275925b9c0f551b53665152722f57acd7b2e839f9da55435511e557'
AND (
token = 'uqz5Jpsjg7P0QoEFHvQBMiPguN15RkuA95qnzVJDSC8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)