UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2OdtfJaBmuWNQykL+d7HEAaOwC7IeExFyfNHBr4GBo4='
WHERE
key_id = 'c420331c3362684a9a28e3e693389c27639f9a54d59c5a0c6631dbd3f2aac338'
AND (
token = '2OdtfJaBmuWNQykL+d7HEAaOwC7IeExFyfNHBr4GBo4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)