UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CFZnMaF2qwzDEc8sdf/8b6NzVUkzekaYjf8SyCyfgoI='
WHERE
key_id = '2bd9090455fe3a943625e758cc98fb31d655e2b690723c866ef646ebfbeaef97'
AND (
token = 'CFZnMaF2qwzDEc8sdf/8b6NzVUkzekaYjf8SyCyfgoI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)