UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rT3l5b8DWEgrch3xTyx+yRXeVEBuLFyZKJ8BgYx9akc='
WHERE
key_id = '4c12d97c79fedc9f896ffe3df76f163fa1d8effd29cf6f9e3e43d8cb462cd434'
AND (
token = 'rT3l5b8DWEgrch3xTyx+yRXeVEBuLFyZKJ8BgYx9akc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)