UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oNXaDBUnCuTALSTGyabiO7tGLAJnxo/23L6qg1qS0xc='
WHERE
key_id = 'b03c9f20ab5ee8fc9fac4982638ea91e00d0e508b48ff9d3472a53f588cc03e5'
AND (
token = 'oNXaDBUnCuTALSTGyabiO7tGLAJnxo/23L6qg1qS0xc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)