UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4zs58JPOwBa2mfiZLHQiU4+xULUxLaJzg/wYx3EDwYE='
WHERE
key_id = '83e0868ae720eec041783e20aba81624dbfc7ff85e875f94242f616ec6e823eb'
AND (
token = '4zs58JPOwBa2mfiZLHQiU4+xULUxLaJzg/wYx3EDwYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)