UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8UJA/vbrlAhEf9mq8444VkkI5/bg2pZcZKAVOW+wjc8='
WHERE
key_id = 'a96eae9f4054bf8fbfff633ba21c82bbd20d5d84d3132571d20790a48fc33a72'
AND (
token = '8UJA/vbrlAhEf9mq8444VkkI5/bg2pZcZKAVOW+wjc8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)