UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xBEYx0BesdWA7aW/ujBU95H35bSs+bgsU1KVuMI7qQQ='
WHERE
key_id = 'a93eb77ab60d33bb10d255a40bc9151cb68bcca1a6f5428ff3979b2c708db142'
AND (
token = 'xBEYx0BesdWA7aW/ujBU95H35bSs+bgsU1KVuMI7qQQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)