UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zLvi9wmXthlgAWl32lS/YJhMWZnbwo673QyDfxzBgX8='
WHERE
key_id = '0a83e7da06feb8b0e4db10a7737ef7c4cb8db15b169e5a4e4b1e1dda735e88a0'
AND (
token = 'zLvi9wmXthlgAWl32lS/YJhMWZnbwo673QyDfxzBgX8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)