UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ggSQWeCg27XLKBmRtPJv4ErEYQT5VUYJdDpfKFF5XJk='
WHERE
key_id = '1181e73a66e301d3e4b3141bde722ebb46188559a81b4b7a4ea027814ea5b73a'
AND (
token = 'ggSQWeCg27XLKBmRtPJv4ErEYQT5VUYJdDpfKFF5XJk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)