UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rui0A8JWqKDXbt3FCW9Z2j2CjGZogx4PVo9M1PB64ok='
WHERE
key_id = '6cb52946d5de52d1254b5b85734de02479ac9c3c06d1c06a449d4fbbb004cbf6'
AND (
token = 'rui0A8JWqKDXbt3FCW9Z2j2CjGZogx4PVo9M1PB64ok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)