UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '04BOjrxA4pitl4Sr0XIahCN7kecPxWa4jGIC0cLH30w='
WHERE
key_id = '5e35b1fe1311b287b6f0634b0618afda1ec0e4d9fe1a663d99bfd4d7d052cf45'
AND (
token = '04BOjrxA4pitl4Sr0XIahCN7kecPxWa4jGIC0cLH30w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)