UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PuVUL7h+kstZje3qO7Acjm6uQyL3gcbZkXCfc/tLsUw='
WHERE
key_id = '9322579ad8eba62ad6d459210d87a525320684baf72b1757ea1daa98c7afc481'
AND (
token = 'PuVUL7h+kstZje3qO7Acjm6uQyL3gcbZkXCfc/tLsUw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)