UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gl21yt/odMQR4qfjDpFFIOqk7RCt4XE+ANwSKkSkKi4='
WHERE
key_id = '3a8dda12f349a42824cf35c674ce855003d8c31a9384f3e5154a7c6ea46cbf34'
AND (
token = 'gl21yt/odMQR4qfjDpFFIOqk7RCt4XE+ANwSKkSkKi4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)