UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/gUgXb4xYydcxq3KPDsoBdJqHSLEBEIebBvXnucvniw='
WHERE
key_id = '95716018f5cceada8e633eb8496c40d585205727122c7ceb1bc0037e046bcaae'
AND (
token = '/gUgXb4xYydcxq3KPDsoBdJqHSLEBEIebBvXnucvniw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)