UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6tp7OPjpTEibzzM8zifkC4tk7pOxgWAbrbw/HeoZc98='
WHERE
key_id = 'af6d0ee4b7e6831e5d6684552dc12f6e0cbb4a5b331f63592da2fe5338de81ce'
AND (
token = '6tp7OPjpTEibzzM8zifkC4tk7pOxgWAbrbw/HeoZc98='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)