UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '82xPHJvcI1RT9fK2L+p2LGNFKmZgWPBFPibDI6xqJ68='
WHERE
key_id = '3e41e544be97dcd63922f999d8358007fcebf63e8171f5f6d887bb2a150e9ab9'
AND (
token = '82xPHJvcI1RT9fK2L+p2LGNFKmZgWPBFPibDI6xqJ68='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)