UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4cxmPDELw923ULWxW8RZLYuI27a7IqkJNAuurQIfigE='
WHERE
key_id = '8a14a532afee20e13a7b404b09b9007645d2b8f3fb962d29a87dce01870fc265'
AND (
token = '4cxmPDELw923ULWxW8RZLYuI27a7IqkJNAuurQIfigE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)