UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gLgoZ4IKnHH+n6YyR5V8kSl68ac2XrJHO1p9aXMAZQw='
WHERE
key_id = '4b3b9c736d560ae3dc0a8d7b4a51bdc4ebdc79e0cccde942aefb0c8880df7694'
AND (
token = 'gLgoZ4IKnHH+n6YyR5V8kSl68ac2XrJHO1p9aXMAZQw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)