UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xAt93BDVbeGTgAy5Uees3N6vYz/ZSxBeC+egHgrdlhw='
WHERE
key_id = '0b0274a5dc48ed63b48dbff5db858a4fae8183df245db6e9d2299b2c75807314'
AND (
token = 'xAt93BDVbeGTgAy5Uees3N6vYz/ZSxBeC+egHgrdlhw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)