UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VchYUrk2xcRp8I9NRc/TIykzxSvb3ZJ7x14R1ZM3hiM='
WHERE
key_id = 'd5cb7e10fe6e7e5d0dac59fbea10991ddad2b0171d31ac174587621d3b8bcb4f'
AND (
token = 'VchYUrk2xcRp8I9NRc/TIykzxSvb3ZJ7x14R1ZM3hiM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)