UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oNc3e2FxXJNOzg7234PUfyuoEBTH/uetDilun7CRX4I='
WHERE
key_id = '113367a2e976a3ac6f850b8f74eaccc574774b7717cfe1ea9ee2d60d1b06e7dc'
AND (
token = 'oNc3e2FxXJNOzg7234PUfyuoEBTH/uetDilun7CRX4I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)