UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9wNo6ChHcGWjGXLnXlbYiLIby/+N7XnsswaM90OkkTI='
WHERE
key_id = 'd48227c91271037eebcd23506cb8201169f59ef76c7a63032f09bbeb5a54d9dd'
AND (
token = '9wNo6ChHcGWjGXLnXlbYiLIby/+N7XnsswaM90OkkTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)