UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dfxLvaK/D9gzQitRMq25wteNtCbJnybsnkzZZPwGdFc='
WHERE
key_id = '0987150832985fc911b40e984a9dff34c74946de78e86c74dd003fe90b407330'
AND (
token = 'dfxLvaK/D9gzQitRMq25wteNtCbJnybsnkzZZPwGdFc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)