UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5tqhSwMScE+PhiOuX29lqRl2tpFNrhpxShq7nomWyfM='
WHERE
key_id = '4b4999521a9e0c51f3f6323d49ea958b00ac739108355c1ca188c768fe84189e'
AND (
token = '5tqhSwMScE+PhiOuX29lqRl2tpFNrhpxShq7nomWyfM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)