UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L3gRAf58pHhqTg2rRnbVWrMRj7c9qz9Dx1Q97vn+RAE='
WHERE
key_id = '3c6d90bb96b0cf481e3f76af42d172322d0f5a405385500432237f9dfc20a463'
AND (
token = 'L3gRAf58pHhqTg2rRnbVWrMRj7c9qz9Dx1Q97vn+RAE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)