UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qR1QBlH1TpEuxLTsTpT9JBBbZK/FFmE2eALocnl5QKY='
WHERE
key_id = '7614be0eb90735a055aab8e0f8c0de644919c8a4161aa3c9bfc3ca04d1e382bf'
AND (
token = 'qR1QBlH1TpEuxLTsTpT9JBBbZK/FFmE2eALocnl5QKY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)