UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '92b7++hJ7KzrazvdJoPMPmyT+wAirkBNRR6fiaI+jE8='
WHERE
key_id = 'a4e0fea46de67a0337d2fbf3cbbdc86035e8daf3828df1c7a9c14fb425f25c82'
AND (
token = '92b7++hJ7KzrazvdJoPMPmyT+wAirkBNRR6fiaI+jE8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)