UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MFg7cYKiwpoQGkLQckaChxnPrj9rkh65Ku+RRiM6AaE='
WHERE
key_id = '5ca7cb13a85f924f28f36fc6f2a027e32e1fc40a532413c9f0ea6ff7652074db'
AND (
token = 'MFg7cYKiwpoQGkLQckaChxnPrj9rkh65Ku+RRiM6AaE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)